

    const filesystemController = require('../controller/filesystemController');
    const oauthCheck = require('../middleware/oauthCheck');
    const router = require('koa-router')();

    router.prefix('/filesystem');
    
    // router.all('*', oauthCheck.apiJwtCheck)
    // router.all('*', oauthCheck.sessionCheck)

    router.get('/', oauthCheck.sessionCheck);
    router.get('/', filesystemController.userdata);

    router.get('/login', filesystemController.login);
    router.post('/checklogin', filesystemController.checklogin);
    router.get('/logout', filesystemController.logout);
    router.get('/error', filesystemController.error)

    router.get('/file', oauthCheck.sessionCheck);
    router.get('/file', filesystemController.file);

    router.get('/role', oauthCheck.sessionCheck);
    router.get('/role', filesystemController.role);
    router.post('/rolesearch', filesystemController.rolesearch)
    router.get('/addUserPage', filesystemController.addUserPage);
    router.post('/addUserPage/add', filesystemController.addUser);
    router.get('/deleteUser', filesystemController.deleteUser);

    module.exports = router;